package ${basePackage}.model;

import lombok.Data;

<#macro generateModel modelInfo>
    <#if modelInfo.description??>
        /**
        * ${modelInfo.description}
        */
    </#if>
    public ${modelInfo.type} ${modelInfo.fieldName} = <#if modelInfo.defaultValue??>  ${modelInfo.defaultValue?c} </#if>;
</#macro>

/**
* 数据模型
*/
@Data
public class DataModel {
<#list modelConfig.models as modelInfo>

    <#--    有分组-->
    <#if modelInfo.groupKey??>
        <#if modelInfo.description??>
            /**
            * ${modelInfo.description}
            */
        </#if>
        public ${modelInfo.type} ${modelInfo.groupKey} = new ${modelInfo.type}();
        @Data
        public static class ${modelInfo.type}{
            <#list modelInfo.models as modelInfo>
                <@generateModel modelInfo = modelInfo />
            </#list>
        }
    <#else>
        <@generateModel modelInfo = modelInfo />
    </#if>

</#list>
}
